<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
		method="xml" encoding="UTF-8" />
	<xsl:template match="/">
		<xsl:variable name="toMap" select=".//site/toMap" />
		<xsl:variable name="currDoor" select=".//site/currDoor" />
		<xsl:variable name="toDoor" select=".//site/toDoor" />
		<p>
		<input type="hidden" id="currDoor" value="{$currDoor}"/>
		<select id="listMaps">
			<option value="0" />
			<xsl:for-each select=".//site/maps/map">
				<xsl:if test="$toMap = id">
					<option value="{id}" selected="selected">
						<xsl:value-of select="name" />
					</option>
				</xsl:if>
				<xsl:if test="$toMap != id">
					<option value="{id}">
						<xsl:value-of select="name" />
					</option>
				</xsl:if>
			</xsl:for-each>
		</select>
		</p>
		<p>
		<xsl:for-each select=".//site/maps/map">
			<select id="mapDoor_{id}">
				<option value="0" />
				<xsl:for-each select="doors/door">
					<xsl:if test="toid = 0 or id = $toDoor">
						<xsl:if test="id = $toDoor">
							<option value="{id}" selected="selected">
								<xsl:value-of select="point" />
							</option>
						</xsl:if>
						<xsl:if test="id != $toDoor">
							<option value="{id}">
								<xsl:value-of select="point" />
							</option>
						</xsl:if>
					</xsl:if>
				</xsl:for-each>
			</select>
		</xsl:for-each>
		</p>
		<p id="mapListInfo">
			
		</p>
		<p>
			<input type="button" id="mapDoorSave" value="sauver" />
		</p>
	</xsl:template>
</xsl:stylesheet>

